<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQiiArticleTypeVideoTable extends Migration
{
    /**
     * Schema table name to migrate
     * @var string
     */
    public $set_schema_table = 'qii_article_type_video';

    /**
     * Run the migrations.
     * @table qii_article_type_video
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable($this->set_schema_table)) return;
        Schema::create($this->set_schema_table, function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id')->comment('视频ID');
            $table->string('title', 220)->default('')->comment('视频名称');
            $table->string('zhand', 200)->default('')->comment('文章名称');
            $table->enum('unit', ['K', 'M', 'G'])->nullable()->default('M')->comment('视频大小单位');
            $table->text('desc')->comment('简介');
            $table->enum('playtype', ['local', 'code'])->nullable()->default('local')->comment('播放方式(local:站内mp4文件,code:视频网站的播放代码)');
            $table->text('content')->nullable()->default(null)->comment('播放代码或站内文件地址');
            $table->string('litpic_title')->default('')->comment('缩略图标题');
            $table->string('litpic_alt')->default('')->comment('缩略图alt');
            $table->string('litpic', 200)->default('')->comment('缩略图');
            $table->longText('cont')->nullable()->default(null)->comment('内容');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
     public function down()
     {
       Schema::dropIfExists($this->set_schema_table);
     }
}
